<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%@page import="com.lmpop.trade.ti_goods.*" %>
<jsp:useBean id="bean" class="com.lmpop.frame.util.RandomID" scope="page"/>

<%
	String pri_key = bean.GenTradeId();
	String user_id="";
	String cust_id = "";

 	if(session.getAttribute("session_user_id")!=null){
	     user_id  =session.getAttribute("session_user_id").toString();
	}
	if (request.getParameter("cust_id") != null	&& !request.getParameter("cust_id").equals("")) {
		cust_id = request.getParameter("cust_id");		 
	}

%>
<html>
  <head>
    <title>添加礼品信息</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="index.js"></script>
 	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ti_giftInfo.js'></script> 
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ts_categoryInfo.js'></script> 
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ti_goodsInfo.js'></script>     
	<script type="text/javascript" src="/program/admin/goods/s_classify.js"></script>
</head>

<body >
	<h1>添加礼品信息</h1>
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	
	<input name="gift_id" id="gift_id" type="hidden" value="<%=pri_key%>"/>
	<input name="cust_id" id="cust_id" type="hidden" value="<%=cust_id%>"/>

	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
		<tr>
			<td align="right" width="20%">
				礼品名称：<font color="red">*</font>
			</td>
			<td><input name="gift_name" id="gift_name" size="20" maxlength="100" type="text" /></td>
		</tr>
		
		<tr>
			<td align="right" width="20%">
				礼品分类：<font color="red">*</font>
			</td>
			<td>
			    <select name="sort1" id="sort1" onclick="setSecondClass(this.value);" >
							  <option value="">请选择</option>
				</select>	
				<select name="sort2" id="sort2" onclick="setTherdClass(this.value);">
							  <option value="">请选择</option>
				</select>		
			</td>
		</tr>
		
		<tr style="display:none">
			<td align="right" width="20%">
				礼品类型：<font color="red">*</font>
			</td>
			<td>
				<input  id="gift_type1" name="gift_type1" value="1" type="radio" checked="checked"/>礼品			 
			</td>
		</tr>
	
	 <tr>
			<td align="right" width="20%">
				礼品图片：		
			</td>
			<td  width="80%">
				<jsp:include page="/program/inc/uploadImgInc.jsp">
					 <jsp:param name="attach_root_id" value="<%=pri_key%>" />
				</jsp:include>

			
			</td>
		</tr>
		
		
		<tr>
			<td align="right" width="20%">
				详细说明：
			</td>
			<td>
			<textarea name="gift_desc" id="gift_desc" cols="50" rows="10"></textarea>
			</td>
		</tr>
		
		<tr style="display:none">
			<td align="right" width="20%">
				期初库存：
			</td>
			<td><input name="stock_num" id="stock_num" size="20" maxlength="20" type="text" value="0" onKeyUp="if(isNaN(value))this.value=''"/></td>
		</tr>
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="1669" />
				<input name="state_code" id="state_code" type="hidden" value="1" />
				<input name="class_attr" id="class_attr" type="hidden" />
				<input name="user_id" id="user_id" type="hidden" value="<%=user_id %>"/>
				<input type="button" class="buttoncss" name="tradeSub" value="提交" onclick="return checkSub('addForm');"/>&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='giftindex.jsp?cust_id=<%=cust_id%>';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
